package material.adapterAndFacade.duck;


import java.util.concurrent.ConcurrentHashMap;

public class DuckTestDriver {
    public static void main(String[] args) {
        /**先创建一只鸭子和一只火鸡**/
        MallardDuck duck = new MallardDuck();
        WildTurkey turkey = new WildTurkey();
        /**将火鸡包装进一个火鸡适配器中，使他看起来像一只鸭子**/
        Duck turkeyAdapter = new TurkeyAdapter(turkey);
        /**测试这只火鸡，让他咯咯叫**/
        System.out.print("火鸡叫声：");
        turkey.gobble();
        System.out.print("鸭子叫声：");
        duck.quack();
        System.out.print("使用适配器的鸭子叫声：");
        turkeyAdapter.quack();
        System.out.println("-----------使用适配器的鸭子飞行行为：-------------");
        turkeyAdapter.fly();

    }
}
